Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use alert details page URL for the log threshold rule if the config is enabled #161175

Merged

Conversation

maryam-saeidi
Copy link
Member

@maryam-saeidi maryam-saeidi commented Jul 4, 2023

Fixes #161117

Summary

If xpack.observability.unsafe.alertDetails.logs.enabled is enabled, we will use the new alert details page URL in context.alertDetailsUrl otherwise, we send the user to the alerts page filtered for that alert. (Partially brings back the logic for alert details URL and getAlertDetailsConfig)

🧪 How to test

  1. Set xpack.observability.unsafe.alertDetails.logs.enabled as false in Kibana yml config or remove the config
  2. Create a log threshold rule with an action for both active state and recovered state
  3. When the alert is triggered, check the default message, it should include the alertDetailsURL, by clicking on that, you should land on the alerts page filtered for that alert
  4. Make the alert recovered and check and similar URL should be generated

New alert details page:

  1. Set xpack.observability.unsafe.alertDetails.logs.enabled as true in Kibana yml config
  2. Repeat the steps 2,3,4 as mentioned before
  3. This time, you should land on the new alert details page

image

@maryam-saeidi maryam-saeidi self-assigned this Jul 4, 2023
@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@maryam-saeidi maryam-saeidi added release_note:skip Skip the PR/issue when compiling release notes backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) labels Jul 4, 2023
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Unknown metric groups

ESLint disabled line counts

id before after diff
enterpriseSearch 14 16 +2
securitySolution 410 414 +4
total +6

Total ESLint disabled count

id before after diff
enterpriseSearch 15 17 +2
securitySolution 489 493 +4
total +6

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @maryam-saeidi

@maryam-saeidi maryam-saeidi marked this pull request as ready for review July 4, 2023 15:06
@maryam-saeidi maryam-saeidi requested review from a team as code owners July 4, 2023 15:06
Copy link
Contributor

@tonyghiani tonyghiani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👌

Copy link
Contributor

@benakansara benakansara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Tested locally, and works as expected.

@maryam-saeidi maryam-saeidi merged commit f758ba4 into elastic:main Jul 5, 2023
@maryam-saeidi maryam-saeidi deleted the 161117-fix-view-alert-details branch July 5, 2023 10:40
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 5, 2023
…s enabled (elastic#161175)

Fixes elastic#161117

## Summary

If `xpack.observability.unsafe.alertDetails.logs.enabled` is enabled, we
will use the new alert details page URL in `context.alertDetailsUrl`
otherwise, we send the user to the alerts page filtered for that alert.
(Partially brings back [the logic for alert details
URL](https://github.com/elastic/kibana/pull/157987/files#diff-a71ca536380c1fde8805744b23566ce795707f92b94a03af73347cac46ccac63L1027)
and
[getAlertDetailsConfig](https://github.com/elastic/kibana/pull/157987/files#diff-a71ca536380c1fde8805744b23566ce795707f92b94a03af73347cac46ccac63L1027))

## 🧪 How to test

1. Set `xpack.observability.unsafe.alertDetails.logs.enabled` as false
in Kibana yml config or remove the config
2. Create a log threshold rule with an action for both active state and
recovered state
3. When the alert is triggered, check the default message, it should
include the alertDetailsURL, by clicking on that, you should land on the
alerts page filtered for that alert
4. Make the alert recovered and check and similar URL should be
generated

New alert details page:

1. Set `xpack.observability.unsafe.alertDetails.logs.enabled` as true in
Kibana yml config
2. Repeat the steps 2,3,4 as mentioned before
3. This time, you should land on the new alert details page

![image](https://github.com/elastic/kibana/assets/12370520/a2f99bd7-cfaa-4146-bedf-72458973b463)

(cherry picked from commit f758ba4)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.9

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jul 5, 2023
…nfig is enabled (#161175) (#161241)

# Backport

This will backport the following commits from `main` to `8.9`:
- [Use alert details page URL for the log threshold rule if the config
is enabled (#161175)](#161175)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Maryam
Saeidi","email":"maryam.saeidi@elastic.co"},"sourceCommit":{"committedDate":"2023-07-05T10:39:58Z","message":"Use
alert details page URL for the log threshold rule if the config is
enabled (#161175)\n\nFixes #161117\r\n\r\n## Summary\r\n\r\nIf
`xpack.observability.unsafe.alertDetails.logs.enabled` is enabled,
we\r\nwill use the new alert details page URL in
`context.alertDetailsUrl`\r\notherwise, we send the user to the alerts
page filtered for that alert.\r\n(Partially brings back [the logic for
alert
details\r\nURL](https://github.com/elastic/kibana/pull/157987/files#diff-a71ca536380c1fde8805744b23566ce795707f92b94a03af73347cac46ccac63L1027)\r\nand\r\n[getAlertDetailsConfig](https://github.com/elastic/kibana/pull/157987/files#diff-a71ca536380c1fde8805744b23566ce795707f92b94a03af73347cac46ccac63L1027))\r\n\r\n##
🧪 How to test\r\n\r\n1. Set
`xpack.observability.unsafe.alertDetails.logs.enabled` as false\r\nin
Kibana yml config or remove the config\r\n2. Create a log threshold rule
with an action for both active state and\r\nrecovered state\r\n3. When
the alert is triggered, check the default message, it should\r\ninclude
the alertDetailsURL, by clicking on that, you should land on
the\r\nalerts page filtered for that alert\r\n4. Make the alert
recovered and check and similar URL should be\r\ngenerated\r\n\r\nNew
alert details page:\r\n\r\n1. Set
`xpack.observability.unsafe.alertDetails.logs.enabled` as true
in\r\nKibana yml config\r\n2. Repeat the steps 2,3,4 as mentioned
before\r\n3. This time, you should land on the new alert details
page\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/12370520/a2f99bd7-cfaa-4146-bedf-72458973b463)","sha":"f758ba47507fb3ec18ffbaeab32ff36ea828dd2c","branchLabelMapping":{"^v8.10.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:prev-minor","v8.10.0"],"number":161175,"url":"https://github.com/elastic/kibana/pull/161175","mergeCommit":{"message":"Use
alert details page URL for the log threshold rule if the config is
enabled (#161175)\n\nFixes #161117\r\n\r\n## Summary\r\n\r\nIf
`xpack.observability.unsafe.alertDetails.logs.enabled` is enabled,
we\r\nwill use the new alert details page URL in
`context.alertDetailsUrl`\r\notherwise, we send the user to the alerts
page filtered for that alert.\r\n(Partially brings back [the logic for
alert
details\r\nURL](https://github.com/elastic/kibana/pull/157987/files#diff-a71ca536380c1fde8805744b23566ce795707f92b94a03af73347cac46ccac63L1027)\r\nand\r\n[getAlertDetailsConfig](https://github.com/elastic/kibana/pull/157987/files#diff-a71ca536380c1fde8805744b23566ce795707f92b94a03af73347cac46ccac63L1027))\r\n\r\n##
🧪 How to test\r\n\r\n1. Set
`xpack.observability.unsafe.alertDetails.logs.enabled` as false\r\nin
Kibana yml config or remove the config\r\n2. Create a log threshold rule
with an action for both active state and\r\nrecovered state\r\n3. When
the alert is triggered, check the default message, it should\r\ninclude
the alertDetailsURL, by clicking on that, you should land on
the\r\nalerts page filtered for that alert\r\n4. Make the alert
recovered and check and similar URL should be\r\ngenerated\r\n\r\nNew
alert details page:\r\n\r\n1. Set
`xpack.observability.unsafe.alertDetails.logs.enabled` as true
in\r\nKibana yml config\r\n2. Repeat the steps 2,3,4 as mentioned
before\r\n3. This time, you should land on the new alert details
page\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/12370520/a2f99bd7-cfaa-4146-bedf-72458973b463)","sha":"f758ba47507fb3ec18ffbaeab32ff36ea828dd2c"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.10.0","labelRegex":"^v8.10.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/161175","number":161175,"mergeCommit":{"message":"Use
alert details page URL for the log threshold rule if the config is
enabled (#161175)\n\nFixes #161117\r\n\r\n## Summary\r\n\r\nIf
`xpack.observability.unsafe.alertDetails.logs.enabled` is enabled,
we\r\nwill use the new alert details page URL in
`context.alertDetailsUrl`\r\notherwise, we send the user to the alerts
page filtered for that alert.\r\n(Partially brings back [the logic for
alert
details\r\nURL](https://github.com/elastic/kibana/pull/157987/files#diff-a71ca536380c1fde8805744b23566ce795707f92b94a03af73347cac46ccac63L1027)\r\nand\r\n[getAlertDetailsConfig](https://github.com/elastic/kibana/pull/157987/files#diff-a71ca536380c1fde8805744b23566ce795707f92b94a03af73347cac46ccac63L1027))\r\n\r\n##
🧪 How to test\r\n\r\n1. Set
`xpack.observability.unsafe.alertDetails.logs.enabled` as false\r\nin
Kibana yml config or remove the config\r\n2. Create a log threshold rule
with an action for both active state and\r\nrecovered state\r\n3. When
the alert is triggered, check the default message, it should\r\ninclude
the alertDetailsURL, by clicking on that, you should land on
the\r\nalerts page filtered for that alert\r\n4. Make the alert
recovered and check and similar URL should be\r\ngenerated\r\n\r\nNew
alert details page:\r\n\r\n1. Set
`xpack.observability.unsafe.alertDetails.logs.enabled` as true
in\r\nKibana yml config\r\n2. Repeat the steps 2,3,4 as mentioned
before\r\n3. This time, you should land on the new alert details
page\r\n\r\n\r\n![image](https://github.com/elastic/kibana/assets/12370520/a2f99bd7-cfaa-4146-bedf-72458973b463)","sha":"f758ba47507fb3ec18ffbaeab32ff36ea828dd2c"}}]}]
BACKPORT-->

Co-authored-by: Maryam Saeidi <maryam.saeidi@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) release_note:skip Skip the PR/issue when compiling release notes v8.9.0 v8.10.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[AO] "View alert details" link of log alerts does not link to alert details
6 participants